import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'


export default defineConfig({
  base:"/pc_site",
  plugins: [
    vue(),
    AutoImport({
      resolvers: [ElementPlusResolver({
        importStyle: 'sass',
      })],
    }),
    Components({
      resolvers: [ElementPlusResolver({
        importStyle: 'sass',
      })],
    }),
    createSvgIconsPlugin({
      // 指定需要缓存的图标文件夹
      iconDirs: ['D:\\project\\tju\\data-query\\www\\pc\\src\\assets\\icons'],
      // 指定symbolId格式
      symbolId: 'icon-[dir]-[name]',
    }),
  ],
  resolve: {
    alias: {
      '@': 'D:\\project\\tju\\data-query\\www\\pc\\src'  // 为./src配置别名
    }
  },
  server: {
    port:5170,    
    proxy: {
      '/api/': {
        target: 'http://localhost:8097'        
      },
    }
  },
  publicDir:'public'
})
